import requests
from lxml import etree
url = 'https://www.imooc.com/course/list'

res = requests.get(url)
print(res.status_code)

xhtml = etree.HTML(res.text)
tupian = xhtml.xpath('//div[@class="img"]/@style')
print(tupian)
title = xhtml.xpath('//p[@class="title ellipsis2"]/text()')
print(title)
renshu = xhtml.xpath('//p[@class="one"]/text()')
print(renshu)
free = xhtml.xpath('//p[@class="two clearfix"]/span')
print(free)